#-------------------------------------------------------------------------------
# Name:        converter_error.py
# Purpose:     Class to raise converter errors
#       
# Authors:     Glenn Ramsey <glenn.ramsey@slidespeech.com>
#              John Graves <john.graves@slidespeech.com>
#
# Created:     19 April 2012
# Copyright:   (c) Slidespeech Ltd 2012
# Licence:     MIT license
#-------------------------------------------------------------------------------'''

class ConverterError(Exception):
    def __init__(self, msg, cause=None):
        """@param msg: the message to show the user
        @param cause: optional, if reraising this is the caught exception
        """ 
        Exception.__init__(self, msg)
        self.cause = cause
        
    def __str__(self):
        if self.cause is not None:
            return super(Exception, self).__str__() + " : " + str(self.cause)
        else:
            return super(Exception, self).__str__() 
